﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/web/Shared/_Layout.cshtml";
   DTcms.Model.channel_site site = ViewData["site"] as DTcms.Model.channel_site;
   DTcms.Model.siteconfig config = ViewData["config"] as DTcms.Model.siteconfig;
   BaseController bc = ViewBag.BasePage as BaseController;
   PaymentController c = ViewBag.This as PaymentController;
   DTcms.Model.payment payModel = c.payModel;
   DTcms.Model.users userModel = c.userModel;
   DTcms.Model.orders orderModel = c.orderModel;
   ViewBag.Title = "支付中心 - " + site.name;
   string action =ViewBag.Action;
   string order_no = ViewBag.OrderNo;
   string order_type = ViewBag.OrderType;
   string order_amount = ViewBag.OrderAmount;
}

<div class="main-box">
  <div class="section clearfix">
  @if(action=="confirm"){
    <!--确认订单-->
    <form id="payForm" name="payForm" method="post" action="@(config.webpath)api/payment/@payModel.api_path/index.aspx" target="_blank">
    <input id="pay_order_no" name="pay_order_no" type="hidden" value="@order_no" />
    <input id="pay_order_amount" name="pay_order_amount" type="hidden" value="@order_amount" />
    <input id="pay_user_name" name="pay_user_name" type="hidden" value="@userModel.user_name" />

    @if(order_type=="recharge"){
    <!--充值订单-->
    <input id="pay_subject" name="pay_subject" type="hidden" value="账户充值" />
    <div class="main-tit">
      <h2>支付中心</h2>
    </div>
    <div class="inner-box">
      <div class="dl-list">
        <dl>
          <dt>订 单 号：</dt>
          <dd>@order_no</dd>
        </dl>
        <dl>
          <dt>充值金额：</dt>
          <dd>
            @order_amount 元
          </dd>
        </dl>
        <dl>
          <dt>支付方式：</dt>
          <dd>@payModel.title</dd>
        </dl>
        <dl>
          <dt></dt>
          <dd><input id="btnSubmit" name="btnSubmit" type="submit" class="btn" value="确认支付" /></dd>
        </dl>
      </div>
    </div>
    <!--/充值订单-->
    }
    
    @if(order_type=="buygoods"){
    <!--商品订单-->
    <div class="main-tit">
      <h2>支付中心</h2>
    </div>
    <input id="pay_subject" name="pay_subject" type="hidden" value="购买商品" />
    <div class="inner-box">
      <div class="dl-list">
        <dl>
          <dt>订 单 号：</dt>
          <dd>@order_no</dd>
        </dl>
        <dl>
          <dt>收货人姓名：</dt>
          <dd>@orderModel.accept_name</dd>
        </dl>
        <dl>
          <dt>送货地址：</dt>
          <dd>@orderModel.address</dd>
        </dl>
        <dl>
          <dt>手机号码：</dt>
          <dd>@orderModel.mobile</dd>
        </dl>
        <dl>
          <dt>固定电话：</dt>
          <dd>@orderModel.telphone</dd>
        </dl>
        <dl>
          <dt>备注留言：</dt>
          <dd>@orderModel.message</dd>
        </dl>
        <dl>
          <dt>支付金额：</dt>
          <dd>
            @order_amount 元
          </dd>
        </dl>
        <dl>
          <dt>支付方式：</dt>
          <dd>@payModel.title</dd>
        </dl>
        <dl>
          <dt></dt>
          <dd><input id="btnSubmit" name="btnSubmit" type="submit" class="btn" value="确认支付" /></dd>
        </dl>
      </div>
    </div>
    <!--/商品订单-->
    }
    
    </form>
    <!--/确认订单-->
  }
    
  @if(action=="succeed"){
    <!--支付成功-->
    <div class="main-tit">
      <h2>支付成功</h2>
    </div>
    <div class="inner-box">
      <div class="msg-tips">
        <div class="ico"></div>
        <div class="msg">
          <strong>支付成功啦！</strong>
          <p>恭喜您，您的支付已经成功！</p>
          <p>您可以点击这里进入<a href="@bc.linkurl("usercenter","index")">会员中心</a>查看订单状态！</p>
          <p>如有其它问题，请立即与我们客服人员联系。</p>
        </div>
      </div>
    </div>
    <!--/支付成功-->
  }
    
  @if(action=="error"){
    <!--支付出错-->
    <div class="main-tit">
      <h2>支付失败</h2>
    </div>
    <div class="inner-box">
      <div class="msg-tips">
        <div class="ico error"></div>
        <div class="msg">
          <strong>出错啦，支付失败！</strong>
          <p>支付过程中发生意处错误！</p>
          <p>您可以点击这里进入<a href="@bc.linkurl("usercenter","index")">会员中心</a>查看订单状态！</p>
          <p>如您确实已经支付，请立即与我们客服人员联系。</p>
        </div>
      </div>
    </div>
    <!--/支付出错-->
  }
    
  @if(action=="login"){
    <!--用户未登录-->
    <div class="main-tit">
      <h2>温馨提示</h2>
    </div>
    <div class="inner-box">
      <div class="msg-tips">
        <div class="ico warning"></div>
        <div class="msg">
          <strong>对不起，请登录后再进行支付！</strong>
          <p>您尚未登录或已经超时啦！</p>
          <p>如果您已是会员用户，请<a href="@bc.linkurl("login")">点击这里进行登录</a>！</p>
          <p>如果您尚未成为我们会员，请<a href="@bc.linkurl("register")">点击这里注册</a>。</p>
        </div>
      </div>
    </div>
    <!--/用户未登录-->
  }
    
  @if(action=="recharge"){
    <!--用户余额不足-->
    <div class="main-tit">
      <h2>温馨提示</h2>
    </div>
    <div class="inner-box">
      <div class="msg-tips">
        <div class="ico warning"></div>
        <div class="msg">
          <strong>对不起，您的余额不足本次支付！</strong>
          <p>由于您选择的是余额支付，请确定您的余额是否足够！</p>
          <p>如果余额不足，请<a href="@bc.linkurl("useramount","recharge")">点击这里充值</a>后再进行后续支付！</p>
          <p>如果有任何问题，请与我们客服取得联系。</p>
        </div>
      </div>
    </div>
    <!--/用户余额不足-->
  }
    
  </div>
</div>